﻿<%@ Page Title="" Language="VB" MasterPageFile="~/Master/Site.master" AutoEventWireup="false"
    ValidateRequest="false" CodeFile="MyCampaignFilter.aspx.vb" Inherits="private_secure_members_manage_MyCampaignFilter" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="Server">
    <style type="text/css">
        .style1
        {
            width: 100%;
        }
        .style2
        {
            width: 443px;
        }
        .style3
        {
            width: 128px;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="Server">
    <h2>
        Manage Campaign Filter(s)</h2>
    <h3>
        Save Campaign Filters To Later Contact a Subset of your List</h3>
    <h4>
        You Can Apply these Filters When You Run Your Campaign</h4>
    <hr />
    &nbsp;
    <table id="table1" class="style1">
        <tr>
            <td class="style2" valign="top">
                Choose an Organisation/Business:
                <br />
                <asp:DropDownList ID="ddlEntity" runat="server" DataSourceID="SqlEntity_ds" DataTextField="Name"
                    DataValueField="ID" Width="200px" AutoPostBack="True" AppendDataBoundItems="True">
                    <asp:ListItem Value="0">Select Item from List</asp:ListItem>
                </asp:DropDownList>
                &nbsp;
                <asp:Button ID="btnAddCampaignFilter" runat="server" Text="Add Filter" Visible="false" /><br />
                <asp:SqlDataSource ID="SqlEntity_ds" runat="server" ConnectionString="<%$ ConnectionStrings:ApplicationServices %>"
                    SelectCommand="usp_GetEntityList_ByPersonId" SelectCommandType="StoredProcedure">
                    <SelectParameters>
                        <asp:Parameter Name="PersonId" Type="Int32" />
                    </SelectParameters>
                </asp:SqlDataSource>
            </td>
            <td>
                &nbsp;
            </td>
            <td>
                &nbsp;
            </td>
        </tr>
        <tr>
            <td class="style2">
                &nbsp;
            </td>
            <td>
                &nbsp;
            </td>
            <td>
                &nbsp;
            </td>
        </tr>
        <tr>
            <td class="style2" valign="top">
                Your List of Campaign Filters
            </td>
            <td>
                &nbsp;
            </td>
            <td valign="top">
                <asp:UpdatePanel ID="UpdatePanel4" runat="server" UpdateMode="Conditional">
                    <ContentTemplate>
                        <div id="divSelectedFilterText" runat="server" visible="false">
                            Conditions of Selected Filter</div>
                    </ContentTemplate>
                </asp:UpdatePanel>
            </td>
        </tr>
        <tr>
            <td class="style2" valign="top">
                <asp:UpdatePanel ID="UpdatePanel2" runat="server" UpdateMode="Conditional">
                    <ContentTemplate>
                        <asp:GridView ID="grdCampaignFilter" runat="server" AllowPaging="True" AllowSorting="True"
                            AutoGenerateColumns="False" DataKeyNames="Id" DataSourceID="SqlDataSource1" Width="472px"
                            CellPadding="4" ForeColor="#333333">
                            <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
                            <Columns>
                                <asp:TemplateField ShowHeader="False">
                                    <EditItemTemplate>
                                        <asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="True" CommandName="Update"
                                            Text="Update"></asp:LinkButton>
                                        &nbsp;<asp:LinkButton ID="LinkButton2" runat="server" CausesValidation="False" CommandName="Cancel"
                                            Text="Cancel"></asp:LinkButton>
                                    </EditItemTemplate>
                                    <ItemTemplate>
                                        <asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="False" CommandName="CustomEdit"
                                            Text="Edit" CommandArgument='<%# Bind("Id") %>'></asp:LinkButton>
                                        &nbsp;<asp:LinkButton ID="LinkButton2" runat="server" CausesValidation="False" CommandName="Select"
                                            Text="Select"></asp:LinkButton>
                                        &nbsp;<asp:LinkButton ID="LinkButton3" runat="server" CausesValidation="False" CommandName="Delete"
                                            Text="Delete"></asp:LinkButton>
                                        <asp:ConfirmButtonExtender ID="LinkButton3_ConfirmButtonExtender" runat="server"
                                            ConfirmText="Delete campaign filter list with all filter items ?" Enabled="True"
                                            TargetControlID="LinkButton3">
                                        </asp:ConfirmButtonExtender>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:BoundField DataField="RowNum" HeaderText="#" ReadOnly="True" SortExpression="RowNum" />
                                <asp:BoundField DataField="Id" HeaderText="Id" InsertVisible="False" ReadOnly="True"
                                    SortExpression="Id" Visible="False" />
                                <asp:BoundField DataField="EntityId" HeaderText="EntityId" SortExpression="EntityId"
                                    Visible="False" />
                                <asp:BoundField DataField="Name" HeaderText="Campaign Name" SortExpression="Name" />
                                <asp:BoundField DataField="Note" HeaderText="Campaign Note" SortExpression="Note" />
                                <asp:CheckBoxField DataField="Active" HeaderText="Active" SortExpression="Active"
                                    Visible="False" />
                            </Columns>
                            <EditRowStyle BackColor="#999999" />
                            <EmptyDataTemplate>
                                If there are no Campaign Filters yet for selected entity click <strong>Add Filter</strong>
                                above to get started or choose an item in the list above.
                            </EmptyDataTemplate>
                            <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                            <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                            <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
                            <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
                            <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
                            <SortedAscendingCellStyle BackColor="#E9E7E2" />
                            <SortedAscendingHeaderStyle BackColor="#506C8C" />
                            <SortedDescendingCellStyle BackColor="#FFFDF8" />
                            <SortedDescendingHeaderStyle BackColor="#6F8DAE" />
                        </asp:GridView>
                        <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:ApplicationServices %>"
                            DeleteCommand="usp_CampaignFilterDelete" DeleteCommandType="StoredProcedure"
                            InsertCommand="usp_CampaignFilterUpdate" InsertCommandType="StoredProcedure"
                            SelectCommand="usp_CampaignFilterSelectByEntityId" SelectCommandType="StoredProcedure"
                            UpdateCommand="usp_CampaignFilterUpdate" UpdateCommandType="StoredProcedure">
                            <DeleteParameters>
                                <asp:Parameter Name="Id" Type="Int32" />
                            </DeleteParameters>
                            <InsertParameters>
                                <asp:Parameter Name="Id" Type="Int32" />
                                <asp:Parameter Name="EntityId" Type="Int32" />
                                <asp:Parameter Name="Name" Type="String" />
                                <asp:Parameter Name="Note" Type="String" />
                                <asp:Parameter Name="Active" Type="Boolean" />
                            </InsertParameters>
                            <SelectParameters>
                                <asp:ControlParameter ControlID="ddlEntity" Name="EntityId" PropertyName="SelectedValue"
                                    Type="Int32" />
                            </SelectParameters>
                            <UpdateParameters>
                                <asp:Parameter Name="Id" Type="Int32" />
                                <asp:Parameter Name="EntityId" Type="Int32" />
                                <asp:Parameter Name="Name" Type="String" />
                                <asp:Parameter Name="Note" Type="String" />
                                <asp:Parameter Name="Active" Type="Boolean" />
                            </UpdateParameters>
                        </asp:SqlDataSource>
                        <asp:Panel ID="pnlCampaignFilters" runat="server" Style="display: none" CssClass="modalPopup">
                            <%--                <input id="btnCancel" type="button" value="X" Style="display: none" style="float: right; background-color: #FF0000;" />
                            --%>
                            <asp:Button ID="Button4" runat="server" CausesValidation="false" Style="float: right;
                                background-color: #FF0000;" Text="X" />
                            <h2>
                                <asp:Label ID="Label6" runat="server" Text="Campaign Filter Conditions"></asp:Label>
                            </h2>
                            <table style="width: 100%;">
                                <tr>
                                    <td valign="top" class="style3">
                                        Name of Filter:
                                    </td>
                                    <td valign="top">
                                        <asp:TextBox ID="TextBox5" runat="server"></asp:TextBox>
                                        <asp:Label ID="Label7" runat="server" Text=""></asp:Label>
                                        <br />
                                    </td>
                                    <td>
                                        &nbsp;
                                    </td>
                                </tr>
                                <tr>
                                    <td class="style3" valign="top">
                                        Your Note:
                                    </td>
                                    <td valign="top">
                                        <asp:TextBox ID="TextBox6" runat="server"></asp:TextBox>
                                    </td>
                                    <td>
                                        &nbsp;
                                    </td>
                                </tr>
                                <tr>
                                    <td class="style3">
                                        &nbsp;
                                    </td>
                                    <td>
                                        <asp:Button ID="Button5" runat="server" Text="Submit" />
                                        <asp:HiddenField ID="HiddenField2" runat="server" />
                                    </td>
                                    <td>
                                        &nbsp;
                                    </td>
                                </tr>
                            </table>
                            <asp:Button ID="Button6" runat="server" Style="display: none;" Text="Button" />
                            <asp:ModalPopupExtender ID="ModalPopupExtender2" runat="server" BackgroundCssClass="modalBackground"
                                DropShadow="true" DynamicServicePath="" Enabled="True" PopupControlID="pnlCampaignFilters"
                                TargetControlID="Button6">
                            </asp:ModalPopupExtender>
                        </asp:Panel>
                    </ContentTemplate>
                </asp:UpdatePanel>
                <br />
            </td>
            <td>
                &nbsp;
            </td>
            <td valign="top">
                <asp:UpdatePanel ID="UpdatePanel3" runat="server" UpdateMode="Conditional" ChildrenAsTriggers="true">
                    <ContentTemplate>
                        <asp:Label ID="lblMessage" runat="server" Text=""></asp:Label>
                        <asp:GridView ID="grdCampaignFilterItem" runat="server" AllowPaging="True" AllowSorting="True"
                            AutoGenerateColumns="False" DataKeyNames="Id" DataSourceID="SqlDataSource2" Width="361px"
                            ShowFooter="True" EnableViewState="False" EmptyDataText="There is no conditions for selected campaign filter."
                            CellPadding="4" ForeColor="#333333">
                            <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
                            <Columns>
                                <asp:TemplateField ShowHeader="False">
                                    <EditItemTemplate>
                                        <asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="True" CommandName="Update"
                                            Text="Update"></asp:LinkButton>
                                        &nbsp;<asp:LinkButton ID="LinkButton2" runat="server" CausesValidation="False" CommandName="Cancel"
                                            Text="Cancel"></asp:LinkButton>
                                    </EditItemTemplate>
                                    <FooterTemplate>
                                        <asp:Button ID="btnInsert" runat="Server" Text="Insert" CommandName="Insert" UseSubmitBehavior="False" />
                                    </FooterTemplate>
                                    <ItemTemplate>
                                        <asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="False" CommandName="CustomEdit"
                                            Text="Edit" CommandArgument='<%# Bind("Id") %>'></asp:LinkButton>
                                        &nbsp;<asp:LinkButton ID="LinkButton2" runat="server" CausesValidation="False" CommandName="Delete"
                                            Text="Delete"></asp:LinkButton>
                                        <asp:ConfirmButtonExtender ID="LinkButton2_ConfirmButtonExtender" runat="server"
                                            ConfirmText="Delete filter item ?" Enabled="True" TargetControlID="LinkButton2">
                                        </asp:ConfirmButtonExtender>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:BoundField DataField="Id" HeaderText="Id" InsertVisible="False" ReadOnly="True"
                                    SortExpression="Id" Visible="False" />
                                <asp:BoundField DataField="CampaignFilterId" HeaderText="CampaignFilterId" SortExpression="CampaignFilterId"
                                    Visible="False" />
                                <asp:TemplateField HeaderText="SeqNo" SortExpression="SeqNo" Visible="False">
                                    <EditItemTemplate>
                                        <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("SeqNo") %>'></asp:TextBox>
                                    </EditItemTemplate>
                                    <FooterTemplate>
                                        <asp:TextBox ID="txtNewInsertSeqNo" runat="server"></asp:TextBox>
                                        <asp:MaskedEditExtender ID="txtNewInsertSeqNo_MaskedEditExtender" runat="server"
                                            Mask="999999999" MessageValidatorTip="true" OnFocusCssClass="MaskedEditFocus"
                                            OnInvalidCssClass="MaskedEditError" MaskType="Number" InputDirection="RightToLeft"
                                            AcceptNegative="Left" ErrorTooltipEnabled="True" TargetControlID="txtNewInsertSeqNo">
                                        </asp:MaskedEditExtender>
                                    </FooterTemplate>
                                    <ItemTemplate>
                                        <asp:Label ID="Label2" runat="server" Text='<%# Bind("SeqNo") %>'></asp:Label>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="Filter Name" SortExpression="SystemFilterId">
                                    <EditItemTemplate>
                                        <asp:DropDownList ID="DropDownList2" runat="server" DataSourceID="SqlDSSystemFilter"
                                            DataTextField="Name" DataValueField="Id" SelectedValue='<%# Bind("SystemFilterId") %>'
                                            Width="160px">
                                        </asp:DropDownList>
                                        <asp:SqlDataSource ID="SqlDSSystemFilter" runat="server" ConnectionString="<%$ ConnectionStrings:ApplicationServices %>"
                                            DeleteCommand="usp_SystemFilterDelete" DeleteCommandType="StoredProcedure" InsertCommand="usp_SystemFilterInsert"
                                            InsertCommandType="StoredProcedure" SelectCommand="usp_SystemFilterSelect_ALL"
                                            SelectCommandType="StoredProcedure" UpdateCommand="usp_SystemFilterUpdate" UpdateCommandType="StoredProcedure">
                                            <DeleteParameters>
                                                <asp:Parameter Name="Id" Type="Int32" />
                                            </DeleteParameters>
                                            <InsertParameters>
                                                <asp:Parameter Name="Name" Type="String" />
                                                <asp:Parameter Name="Note" Type="String" />
                                                <asp:Parameter Name="FilterText" Type="String" />
                                                <asp:Parameter Name="Active" Type="Boolean" />
                                            </InsertParameters>
                                            <UpdateParameters>
                                                <asp:Parameter Name="Id" Type="Int32" />
                                                <asp:Parameter Name="Name" Type="String" />
                                                <asp:Parameter Name="Note" Type="String" />
                                                <asp:Parameter Name="FilterText" Type="String" />
                                                <asp:Parameter Name="Active" Type="Boolean" />
                                            </UpdateParameters>
                                        </asp:SqlDataSource>
                                    </EditItemTemplate>
                                    <FooterTemplate>
                                        <asp:DropDownList ID="ddlInsertNewSystemFilter" runat="server" DataSourceID="SqlDSSystemFilter"
                                            DataTextField="Name" DataValueField="Id" Width="160px">
                                        </asp:DropDownList>
                                        <asp:SqlDataSource ID="SqlDSSystemFilter" runat="server" ConnectionString="<%$ ConnectionStrings:ApplicationServices %>"
                                            DeleteCommand="usp_SystemFilterDelete" DeleteCommandType="StoredProcedure" InsertCommand="usp_SystemFilterInsert"
                                            InsertCommandType="StoredProcedure" SelectCommand="usp_SystemFilterSelect_ALL"
                                            SelectCommandType="StoredProcedure" UpdateCommand="usp_SystemFilterUpdate" UpdateCommandType="StoredProcedure">
                                            <DeleteParameters>
                                                <asp:Parameter Name="Id" Type="Int32" />
                                            </DeleteParameters>
                                            <InsertParameters>
                                                <asp:Parameter Name="Name" Type="String" />
                                                <asp:Parameter Name="Note" Type="String" />
                                                <asp:Parameter Name="FilterText" Type="String" />
                                                <asp:Parameter Name="Active" Type="Boolean" />
                                            </InsertParameters>
                                            <UpdateParameters>
                                                <asp:Parameter Name="Id" Type="Int32" />
                                                <asp:Parameter Name="Name" Type="String" />
                                                <asp:Parameter Name="Note" Type="String" />
                                                <asp:Parameter Name="FilterText" Type="String" />
                                                <asp:Parameter Name="Active" Type="Boolean" />
                                            </UpdateParameters>
                                        </asp:SqlDataSource>
                                    </FooterTemplate>
                                    <ItemTemplate>
                                        <asp:Label ID="Label1" runat="server" Text='<%# Eval("FilterName") %>'></asp:Label>
                                        <asp:SqlDataSource ID="SqlDSSystemFilter" runat="server" ConnectionString="<%$ ConnectionStrings:ApplicationServices %>"
                                            SelectCommand="usp_SystemFilterSelect_ALL" SelectCommandType="StoredProcedure">
                                        </asp:SqlDataSource>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="AndOr" SortExpression="AndOr">
                                    <EditItemTemplate>
                                        <asp:DropDownList ID="DropDownList5" runat="server" SelectedValue='<%# Bind("AndOr") %>'>
                                            <asp:ListItem>And</asp:ListItem>
                                            <asp:ListItem>Or</asp:ListItem>
                                        </asp:DropDownList>
                                    </EditItemTemplate>
                                    <FooterTemplate>
                                        <asp:DropDownList ID="ddlInsertNewAndOr" runat="server" SelectedValue='<%# Bind("AndOr") %>'>
                                            <asp:ListItem>AND</asp:ListItem>
                                            <asp:ListItem>OR</asp:ListItem>
                                        </asp:DropDownList>
                                    </FooterTemplate>
                                    <ItemTemplate>
                                        <asp:Label ID="Label3" runat="server" Text='<%# Bind("AndOr") %>'></asp:Label>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:CheckBoxField DataField="Active" HeaderText="Active" SortExpression="Active"
                                    Visible="False" />
                            </Columns>
                            <EditRowStyle BackColor="#999999" />
                            <EmptyDataTemplate>
                                <table style="width: 100%;">
                                    <tr>
                                        <td>
                                            <asp:Button ID="btnInsert" runat="Server" Text="Insert" CommandName="EmptyInsert"
                                                UseSubmitBehavior="False" />
                                        </td>
                                        <td>
                                            <asp:TextBox ID="txtNewInsertSeqNo" runat="server"></asp:TextBox>
                                            <asp:MaskedEditExtender ID="txtNewInsertSeqNo_MaskedEditExtender" runat="server"
                                                Mask="999999999" MessageValidatorTip="true" OnFocusCssClass="MaskedEditFocus"
                                                OnInvalidCssClass="MaskedEditError" MaskType="Number" InputDirection="RightToLeft"
                                                AcceptNegative="Left" ErrorTooltipEnabled="True" TargetControlID="txtNewInsertSeqNo">
                                            </asp:MaskedEditExtender>
                                        </td>
                                        <td>
                                            <asp:DropDownList ID="ddlInsertNewSystemFilter" runat="server" DataSourceID="SqlDSSystemFilter"
                                                DataTextField="Name" DataValueField="Id" SelectedValue='<%# Bind("SystemFilterId") %>'
                                                Width="160px">
                                            </asp:DropDownList>
                                            <asp:SqlDataSource ID="SqlDSSystemFilter" runat="server" ConnectionString="<%$ ConnectionStrings:ApplicationServices %>"
                                                DeleteCommand="usp_SystemFilterDelete" DeleteCommandType="StoredProcedure" InsertCommand="usp_SystemFilterInsert"
                                                InsertCommandType="StoredProcedure" SelectCommand="usp_SystemFilterSelect_ALL"
                                                SelectCommandType="StoredProcedure" UpdateCommand="usp_SystemFilterUpdate" UpdateCommandType="StoredProcedure">
                                                <DeleteParameters>
                                                    <asp:Parameter Name="Id" Type="Int32" />
                                                </DeleteParameters>
                                                <InsertParameters>
                                                    <asp:Parameter Name="Name" Type="String" />
                                                    <asp:Parameter Name="Note" Type="String" />
                                                    <asp:Parameter Name="FilterText" Type="String" />
                                                    <asp:Parameter Name="Active" Type="Boolean" />
                                                </InsertParameters>
                                                <UpdateParameters>
                                                    <asp:Parameter Name="Id" Type="Int32" />
                                                    <asp:Parameter Name="Name" Type="String" />
                                                    <asp:Parameter Name="Note" Type="String" />
                                                    <asp:Parameter Name="FilterText" Type="String" />
                                                    <asp:Parameter Name="Active" Type="Boolean" />
                                                </UpdateParameters>
                                            </asp:SqlDataSource>
                                        </td>
                                        <td>
                                            <asp:TextBox ID="txtInsertNewAndOr" runat="server"></asp:TextBox>
                                        </td>
                                    </tr>
                                </table>
                            </EmptyDataTemplate>
                            <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                            <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                            <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
                            <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
                            <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
                            <SortedAscendingCellStyle BackColor="#E9E7E2" />
                            <SortedAscendingHeaderStyle BackColor="#506C8C" />
                            <SortedDescendingCellStyle BackColor="#FFFDF8" />
                            <SortedDescendingHeaderStyle BackColor="#6F8DAE" />
                        </asp:GridView>
                        <asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:ApplicationServices %>"
                            DeleteCommand="usp_CampaignFilterItemDelete" DeleteCommandType="StoredProcedure"
                            InsertCommand="usp_CampaignFilterItemInsert" InsertCommandType="StoredProcedure"
                            SelectCommand="usp_CampaignFilterItemSelectByCampaignFilterId" SelectCommandType="StoredProcedure"
                            UpdateCommand="usp_CampaignFilterItemUpdate" UpdateCommandType="StoredProcedure">
                            <DeleteParameters>
                                <asp:Parameter Name="Id" Type="Int32" />
                            </DeleteParameters>
                            <InsertParameters>
                                <asp:Parameter Name="CampaignFilterId" Type="Int32" />
                                <asp:Parameter Name="SeqNo" Type="Byte" />
                                <asp:Parameter Name="SystemFilterId" Type="Int32" />
                                <asp:Parameter Name="AndOr" Type="String" />
                                <asp:Parameter Name="Active" Type="Boolean" />
                            </InsertParameters>
                            <SelectParameters>
                                <asp:ControlParameter ControlID="grdCampaignFilter" Name="Id" PropertyName="SelectedValue"
                                    Type="Int32" />
                            </SelectParameters>
                            <UpdateParameters>
                                <asp:Parameter Name="Id" Type="Int32" />
                                <asp:Parameter Name="CampaignFilterId" Type="Int32" />
                                <asp:Parameter Name="SeqNo" Type="Byte" />
                                <asp:Parameter Name="SystemFilterId" Type="Int32" />
                                <asp:Parameter Name="AndOr" Type="String" />
                                <asp:Parameter Name="Active" Type="Boolean" />
                            </UpdateParameters>
                        </asp:SqlDataSource>
                        <asp:Panel ID="pnlMessageEx" runat="server" Style="display: none" CssClass="modalPopup"
                            Width="322px">
                            <%--                <input id="btnCancel" type="button" value="X" Style="display: none" style="float: right; background-color: #FF0000;" />
                            --%>
                            <asp:Button ID="btnCancel0" runat="server" CausesValidation="false" Style="float: right;
                                background-color: #FF0000;" Text="X" />
                            <h2>
                                <asp:Label ID="lblAction0" runat="server" Text=""></asp:Label>
                            </h2>
                            <asp:Button ID="btnRegistrationSuccess0" runat="server" Style="display: none;" Text="Button" />
                            <asp:ModalPopupExtender ID="InsertPopupExtender0" runat="server" BackgroundCssClass="modalBackground"
                                CancelControlID="btnCancel0" DropShadow="true" DynamicServicePath="" Enabled="True"
                                PopupControlID="pnlMessageEx" TargetControlID="btnRegistrationSuccess0">
                            </asp:ModalPopupExtender>
                        </asp:Panel>
                        <asp:Panel ID="pnlConditions" runat="server" Style="display: none" CssClass="modalPopup">
                            <%--                <input id="btnCancel" type="button" value="X" Style="display: none" style="float: right; background-color: #FF0000;" />
                            --%>
                            <asp:Button ID="Button1" runat="server" CausesValidation="false" Style="float: right;
                                background-color: #FF0000;" Text="X" />
                            <h2>
                                <asp:Label ID="Label4" runat="server" Text="PopUp Heading CampaignFilter"></asp:Label>
                            </h2>
                            <table style="width: 100%;">
                                <tr>
                                    <td valign="top" class="style3">
                                        System Filter Name:
                                    </td>
                                    <td valign="top">
                                        <asp:DropDownList ID="DropDownList4" runat="server" DataSourceID="SqlDSSystemFilter0"
                                            DataTextField="Name" DataValueField="Id" Width="160px">
                                        </asp:DropDownList>
                                        <asp:SqlDataSource ID="SqlDSSystemFilter0" runat="server" ConnectionString="<%$ ConnectionStrings:ApplicationServices %>"
                                            DeleteCommand="usp_SystemFilterDelete" DeleteCommandType="StoredProcedure" InsertCommand="usp_SystemFilterInsert"
                                            InsertCommandType="StoredProcedure" SelectCommand="usp_SystemFilterSelect_ALL"
                                            SelectCommandType="StoredProcedure" UpdateCommand="usp_SystemFilterUpdate" UpdateCommandType="StoredProcedure">
                                            <DeleteParameters>
                                                <asp:Parameter Name="Id" Type="Int32" />
                                            </DeleteParameters>
                                            <InsertParameters>
                                                <asp:Parameter Name="Name" Type="String" />
                                                <asp:Parameter Name="Note" Type="String" />
                                                <asp:Parameter Name="FilterText" Type="String" />
                                                <asp:Parameter Name="Active" Type="Boolean" />
                                            </InsertParameters>
                                            <UpdateParameters>
                                                <asp:Parameter Name="Id" Type="Int32" />
                                                <asp:Parameter Name="Name" Type="String" />
                                                <asp:Parameter Name="Note" Type="String" />
                                                <asp:Parameter Name="FilterText" Type="String" />
                                                <asp:Parameter Name="Active" Type="Boolean" />
                                            </UpdateParameters>
                                        </asp:SqlDataSource>
                                    </td>
                                    <td>
                                        &nbsp;
                                    </td>
                                </tr>
                                <tr>
                                    <td class="style3" valign="top">
                                        AND/OR:
                                    </td>
                                    <td valign="top">
                                        <asp:DropDownList ID="DropDownList6" runat="server">
                                            <asp:ListItem>AND</asp:ListItem>
                                            <asp:ListItem>OR</asp:ListItem>
                                        </asp:DropDownList>
                                    </td>
                                    <td>
                                        &nbsp;
                                    </td>
                                </tr>
                                <tr>
                                    <td class="style3">
                                        &nbsp;
                                    </td>
                                    <td>
                                        <asp:Button ID="Button2" runat="server" Text="Submit" />
                                        <asp:HiddenField ID="HiddenField1" runat="server" />
                                        <asp:HiddenField ID="HiddenField3" runat="server" />
                                    </td>
                                    <td>
                                        &nbsp;
                                    </td>
                                </tr>
                            </table>
                            <asp:Button ID="Button3" runat="server" Style="display: none;" Text="Button" />
                            <asp:ModalPopupExtender ID="ModalPopupExtender1" runat="server" BackgroundCssClass="modalBackground"
                                DropShadow="true" DynamicServicePath="" Enabled="True" PopupControlID="pnlConditions"
                                TargetControlID="Button3">
                            </asp:ModalPopupExtender>
                        </asp:Panel>
                    </ContentTemplate>
                </asp:UpdatePanel>
                <asp:ObjectDataSource ID="ObjectDataSource1" runat="server" DeleteMethod="Delete"
                    InsertMethod="Insert" OldValuesParameterFormatString="original_{0}" SelectMethod="GetData"
                    TypeName="LogginsLogDSTableAdapters.usp_CampaignFilterItemTableAdapter" UpdateMethod="Update">
                    <DeleteParameters>
                        <asp:Parameter Name="Id" Type="Int32" />
                    </DeleteParameters>
                    <InsertParameters>
                        <asp:Parameter Name="CampaignFilterId" Type="Int32" />
                        <asp:Parameter Name="SeqNo" Type="Byte" />
                        <asp:Parameter Name="SystemFilterId" Type="Int32" />
                        <asp:Parameter Name="AndOr" Type="String" />
                        <asp:Parameter Name="Active" Type="Boolean" />
                    </InsertParameters>
                    <SelectParameters>
                        <asp:Parameter Name="Id" Type="Int32" />
                    </SelectParameters>
                    <UpdateParameters>
                        <asp:Parameter Name="Id" Type="Int32" />
                        <asp:Parameter Name="CampaignFilterId" Type="Int32" />
                        <asp:Parameter Name="SeqNo" Type="Byte" />
                        <asp:Parameter Name="SystemFilterId" Type="Int32" />
                        <asp:Parameter Name="AndOr" Type="String" />
                        <asp:Parameter Name="Active" Type="Boolean" />
                    </UpdateParameters>
                </asp:ObjectDataSource>
            </td>
        </tr>
        <tr>
            <td class="style2">
                &nbsp;
                <asp:Panel ID="pnlRegistrationSuccess" runat="server" Style="display: none" CssClass="modalPopup">
                    <%--                <input id="btnCancel" type="button" value="X" Style="display: none" style="float: right; background-color: #FF0000;" />
                    --%>
                    <asp:Button ID="btnCancel" runat="server" CausesValidation="false" Style="float: right;
                        background-color: #FF0000;" Text="X" />
                    <h2>
                        <asp:Label ID="lblAction" runat="server" Text="PopUp Heading CampaignFilter"></asp:Label>
                    </h2>
                    <asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
                        <ContentTemplate>
                            <table style="width: 100%;">
                                <tr>
                                    <td valign="top">
                                        Name of Filter:
                                    </td>
                                    <td valign="top">
                                        <asp:TextBox ID="txtInsertName" runat="server"></asp:TextBox>
                                        <asp:Label ID="lblNameError" runat="server" Text=""></asp:Label>
                                        <br />
                                    </td>
                                    <td>
                                        &nbsp;
                                    </td>
                                </tr>
                                <tr>
                                    <td valign="top">
                                        Your Note:
                                    </td>
                                    <td valign="top">
                                        <asp:TextBox ID="txtInsertNote" runat="server"></asp:TextBox>
                                    </td>
                                    <td>
                                        &nbsp;
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        &nbsp;
                                    </td>
                                    <td>
                                        <asp:Button ID="btnInsertCampainFilter" runat="server" Text="Submit" />
                                    </td>
                                    <td>
                                        &nbsp;
                                    </td>
                                </tr>
                            </table>
                        </ContentTemplate>
                    </asp:UpdatePanel>
                    <asp:Button ID="btnRegistrationSuccess" runat="server" Style="display: none;" Text="Button" />
                    <asp:ModalPopupExtender ID="InsertPopupExtender" runat="server" BackgroundCssClass="modalBackground"
                        DropShadow="true" DynamicServicePath="" Enabled="True" PopupControlID="pnlRegistrationSuccess"
                        TargetControlID="btnRegistrationSuccess">
                    </asp:ModalPopupExtender>
                </asp:Panel>
            </td>
            <td>
                &nbsp;
            </td>
            <td>
                &nbsp;
            </td>
        </tr>
        <tr>
            <td>
                &nbsp;
            </td>
            <td>
                &nbsp;
            </td>
            <td>
                &nbsp;
            </td>
        </tr>
    </table>
</asp:Content>
